using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ResourceLoadPanel : BasePanel
{

    public Text text;
    public Image background;


    public RectTransform fillImage;
    public RectTransform bgImage;

    public override void Open(Vector3 pos, Vector3 scale)
    {
        base.Open(pos, scale);
        SetPorcess(0);
    }

    public void SetPorcess(int p)
    {
        text.text = "loading..." + p.ToString() + "%";
        fillImage.offsetMax = new Vector2((p / 100f - 1) * bgImage.sizeDelta.x, fillImage.offsetMax.y);
    }

}
